package com.kotlin.lib
/*

import okio.IOException
import okio.buffer
import okio.source
import java.io.File
import java.nio.file.Paths

fun main() {

    val sourceFile = Paths.get("E:\\download\\download\\homeBanner.txts").toFile()


//        println(it.readUtf8Line())
*/
/*    sourceFile.source().buffer().use { source ->
        generateSequence { source.readUtf8Line() }
            .forEach(::println)
    }*//*

//    toBeDone()
    readFileByLine("E:\\download\\", "download\\homeBanner.txt", operation = ::println)
}

fun readFileByLine(file: File, operation: (value: String) -> Unit) {
    file.source().buffer().use {
        generateSequence {
            it.readUtf8Line()
        }.forEach(operation)
    }
}

@Throws(IOException::class)
fun readFileByLine(path: String, operation: (value: String) -> Unit) {
    readFileByLine(Paths.get(path).toFile(), operation)
}

*/
/**
 * readFileByLine("E:\\download\\", "download\\homeBanner.txt", operation = ::println)
 *//*

@Throws(IOException::class)
fun readFileByLine(pathFirst: String, vararg more: String, operation: (value: String) -> Unit) {
    readFileByLine(Paths.get(pathFirst, *more).toFile(), operation)
}

@kotlin.jvm.Throws(IOException::class)
fun readFileContent(file: File): String {
    return file.source().buffer().use {
        it.readByteString().utf8()
    }
}

fun toBeDone(): Student = TODO("to do test")
*/
